package com.heima.article.controller.behavior;

/**
 * @Author: Luo Zeqi
 * @Date: 2022/11/17/9:44
 */

import com.heima.article.service.BehaviorService;
import com.heima.model.article.dtos.ArticleInfoDto;
import com.heima.model.article.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 主要是对文章的收藏 和 行为数据回显
 */
@RestController
@Slf4j
public class BehaviorController {

    @Autowired
    private BehaviorService behaviorService;

    @PostMapping("/api/v1/collection_behavior")
    public ResponseResult collectionBehavior(@RequestBody CollectionBehaviorDto collectionBehaviorDto){
        return behaviorService.collectionBehavior(collectionBehaviorDto);
    }

    @PostMapping("/api/v1/article/load_article_behavior")
    public ResponseResult loadArticleBehavior(@RequestBody ArticleInfoDto articleInfoDto){
        return behaviorService.loadArticleBehavior(articleInfoDto);
    }

}
